package com.example.controller;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * Created by Administrator on 2017-4-20.
 */

@RestController
public class HomeController {

    private static final Log log = LogFactory.getLog(HomeController.class);

    @Autowired
    RestTemplate restTemplate;

    public String url = "http://localhost:9986";

    @RequestMapping("/service1")
    public String service1() throws InterruptedException {
        log.info("sleuth-Service1");
        Thread.sleep(200L);
        String str = this.restTemplate.getForObject(url+"/service2",String.class);
        return str;
    }



}
